﻿using HarmonyLib;
using JSONClass;
using KBEngine;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Reflection;
using System.Text;
using System.Threading.Tasks;
using UnityEngine;
using static UnityEngine.UI.Image;

namespace ncs.lingtian
{
    public partial class LingTianMod
    {
        
        #region 声望
        /// <summary>
        /// 声望
        /// </summary>
        [HarmonyPrefix, HarmonyPatch(typeof(PlayerEx), nameof(PlayerEx.AddShengWang))]
        public static void PlayerEx_AddShengWang_Prefix(ref int add)
        {
            Info($"PlayerEx_AddShengWang_Prefix add:{add}");
            var value = add * MainMod.menPaiHaoGan.Value;
            if (value > 0)
            {
                add = value;
            }

        }

        [HarmonyPrefix, HarmonyPatch(typeof(NPCEx), "SuoQuChangeShengWang")]
        public static void NPCEx_SuoQuChangeShengWang_Prefix(ref int shengWang)
        {
            Info($"NPCEx_SuoQuChangeShengWang_Prefix add:{shengWang}");
            var value = shengWang * MainMod.menPaiHaoGan.Value;
            if (value > 0)
            {
                shengWang = value;
            }

        } 
        #endregion


    }
}
